/**
 * Created by Administrator on 2015/12/8.
 */
app.factory('CropImgFactory', function () {
    function CropImg(target) {
        this.target = target;
        this.showView = false;
        this.cropType = 'square';
    }

    CropImg.prototype = {
        imgCrop: function () {
            this.showView = true;
        },
        saveCropImg: function (myCroppedImage) {
            if (myCroppedImage && myCroppedImage.length > 0) {
                this.target(myCroppedImage);
            }
            this.showView = false;
        },
        cancelCropImg: function () {
            this.showView = false;
        }
    }
    // 修改头像部分 start
    CropImg.newInstance = function (target) {
        return new CropImg(target);
    }

    return {
        newInstance: function (target) {
            return CropImg.newInstance(target);
        }
    };
});